sqlite3 = /usr/bin/sqlite3

phrasedir = $(pkgdatadir)

phrase_DATA = phrase.db.dist

EXTRA_DIST = phrase.txt

$(phrase_DATA):
	./phrase.pl < $< > phrase.sqlite
	echo "CREATE TABLE phrases (key TEXT NOT NULL, phrase TEXT NOT NULL, rank INTEGER NOT NULL);" | $(sqlite3) $@
	echo ".import phrase.sqlite phrases" | $(sqlite3) $@

clean-local:
	rm -f $(phrase_DATA) phrase.sqlite

phrase.db.dist: phrase.txt
